package main

import "fmt"

// Author : CSR丶WARRIOR
// Time ： 2020/10/14  22:17
// TOOLS : GoLand
// FILENAME : createPointer.go
// STATEMENT: 创建指针

func main() {
	var num int = 10
	var ptr *int = &num
	fmt.Printf("%p\n", &num)
	fmt.Printf("%p\n", ptr)
	// &num = ptr

	//根据指针获取变量的值
	fmt.Println(*ptr) //10

	//根据指针修改变量的值
	*ptr = 12
	fmt.Println(num) //12
}
